package com.ruoyi.mobile.service.impl;

import com.ruoyi.mobile.domain.DailyDataCountVo;
import com.ruoyi.mobile.domain.MobileDailyDataVo;
import com.ruoyi.mobile.domain.MobileMonthDataVo;
import com.ruoyi.mobile.domain.MonthDataCountVo;
import com.ruoyi.mobile.mapper.MobileDailyStatisticsMapper;
import com.ruoyi.mobile.mapper.MobileMonthStatisticsMapper;
import com.ruoyi.mobile.service.IMobileDataStatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author Jack_Lee
 * @Date 2024/7/17
 */
@Service
public class MobileDataStatisticsServiceImpl implements IMobileDataStatisticsService {

    @Resource
    private MobileDailyStatisticsMapper dailyStatisticsMapper;

    @Resource
    private MobileMonthStatisticsMapper monthStatisticsMapper;

    /**
     * 当日数据统计
     * @param deptId
     * @return
     */
    @Override
    public List<MobileDailyDataVo> dailyDataStatistics(Long deptId) {
        // 判空

        List<MobileDailyDataVo> mobileDailyDataVos = dailyStatisticsMapper.queryDailyData(deptId);

        return mobileDailyDataVos;
    }

    /**
     * 月度统计  TODO 判空 待优化
     * @param dateMap
     * @return
     */
    @Override
    public List<MobileMonthDataVo> MonthDataStatistics(Map<String, Object> dateMap) {
        List<MobileMonthDataVo> mobileMonthDataVos = monthStatisticsMapper.queryMonthStatistics(dateMap);
        return mobileMonthDataVos;

    }

    @Override
    public List<MonthDataCountVo> MonthDataCount(Map<String, Object> dateMap) {
        List<MonthDataCountVo> monthDataCountVos = monthStatisticsMapper.monthDataCount(dateMap);
        return monthDataCountVos;
    }

    @Override
    public List<DailyDataCountVo> DailyDataCount(Map<String, Object> dataMap) {
        List<DailyDataCountVo> dailyDataCountVos = dailyStatisticsMapper.queryDailyCountData(dataMap);
        return dailyDataCountVos;
    }
}
